#!/usr/bin/env Rscript

## ////////////////////////////////////////////////////////////////////////////
##
## aluelab-results.r
##
## - elaborate alucomb.r fit results
##
## ////////////////////////////////////////////////////////////////////////////

source("../../../Common/bin/aluelab.r")

args <- commandArgs(TRUE)

##--- option -s, use S-factors
flag.s.factors =  FALSE
if(any(args == "-h")) {
  ##--- help
  cat("aluelab-results.r [<.rdata file>]\n")
  stop()
}

if (length(args) > 0) {
  file.name = args[1]
} else {
  file.name = "average_alucomb.rdata"
}

##--- get alucomb results and data
load(file.name)

quant.names = names(quant.val)

display.names = c(
  "Gamma5", "Gamma3",
  "Gamma8", "Gamma9", "Gamma10"
  )
# display.names = quant.names
show(rbind(cbind(val=quant.val[display.names], err=quant.err[display.names])))
show(quant.corr[display.names, display.names])
